import api from '@/api/api.js';
import storage from '@/utils/storage';
export default {
  getRoutes(context) {
    api.menu.getSysMenuByAuthority({}).then(res => {
      storage.setItem('menu', res);
      context.commit('initRouters', res);
    });
  },
  initMenu(context) {
    //后端获取菜单数据
    api.menu.getSysMenuByAuthority({}).then(res => {
      context.commit('initMenu', res);
    });
  },
  //切换左侧菜单显示效果
  editChangeCollapse(context, collapse) {
    context.commit('changeEditCollapse', collapse);
  },
  //缓存页面 当前存活的页面
  addIncludeList(context, data) {
    context.commit('addIncludeList', data);
  },
};
